/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.reg;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * <p>Project: jse2302 - RegExp8
 * <p>Powered by webrx On 2023-06-20 17:44:56
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class RegExp8 {
    public static void main(String[] args) {
        String str = """
				<div>hello12121java17</div><div>java 15</div><div><p>java 15</p><span>java 8</p><div>hello java 158</div></div><div><div>java</div></div>
				""";

        //Pattern p = Pattern.compile("<div>[a-z\\s]*?java[a-z\\s]*?</div>");
        Pattern p = Pattern.compile("<div>([^java]*?java[^java]*?)</div>");
        Matcher m = p.matcher(str);
        while(m.find()) {
            System.out.println(m.group(1));
            //System.out.println(m.group().replace("<div>","").replace("</div>",""));
        }


    }
}
